/**
 * Copyright (c) 2016-2019 人人开源 All rights reserved.
 * <p>
 * https://www.renren.io
 * <p>
 * 版权所有，侵权必究！
 */

package io.renren.utils;

import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import jdk.nashorn.internal.parser.DateParser;

import java.util.Date;

/**
 *
 *
 * @author Mark sunlightcs@gmail.com
 */
public class DateTool {

    public static String dayNumberToCharater(Integer dayOfWeek) {
        String charater = "";
        switch (dayOfWeek) {
            case 0:
                charater = "六";
                break;
            case 1:
                charater = "日";
                break;
            case 2:
                charater = "一";
                break;
            case 3:
                charater = "二";
                break;
            case 4:
                charater = "三";
                break;
            case 5:
                charater = "四";
                break;
            case 6:
                charater = "五";
                break;
            case 7:
                charater = "六";
                break;
        }
        return charater;
    }

    public static String getHourMin(String dateStr){
        String res = "";

        Date date = Convert.toDate(dateStr);
        res = String.valueOf(DateUtil.hour(date, true)) + String.valueOf(DateUtil.minute(date));

        return res;
    }
}
